<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>会员管理 - 会员检索 - 信息修改</title>
		<link rel="stylesheet" type="text/css" href="css/reset.css" />
		<link rel="stylesheet" type="text/css" href="css/admin.css" />
		<link rel="stylesheet" type="text/css" href="css/com.css" />
		<script src="js/jquery-1.11.3.js"></script>
		<!--下拉列表三级联动区-->
		<script src="js/jquery-1.7.min.js" type="text/javascript"></script>
		<script src="js/Area.js" type="text/javascript"></script>
		<script src="js/AreaData_min.js" type="text/javascript"></script>
		<script type="text/javascript">
			$(function() {
				initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, '44', '0', '0');
			});

			//得到地区码
			function getAreaID() {
				var area = 0;
				if($("#seachdistrict").val() != "0") {
					area = $("#seachdistrict").val();
				} else if($("#seachcity").val() != "0") {
					area = $("#seachcity").val();
				} else {
					area = $("#seachprov").val();
				}
				return area;
			}

			function showAreaID() {

				//地区码
				var areaID = getAreaID();
				//地区名
				var areaName = getAreaNamebyID(areaID);
				$("#input1").val("areaName");
				return true;
				alert("您选择的地区码：" + areaID + "      地区名：" + areaName);
			}

			//根据地区码查询地区名
			function getAreaNamebyID(areaID) {
				var areaName = "";
				if(areaID.length == 2) {
					areaName = area_array[areaID];
				} else if(areaID.length == 4) {
					var index1 = areaID.substring(0, 2);
					areaName = area_array[index1] + " " + sub_array[index1][areaID];
				} else if(areaID.length == 6) {
					var index1 = areaID.substring(0, 2);
					var index2 = areaID.substring(0, 4);
					areaName = area_array[index1] + " " + sub_array[index1][index2] + " " + sub_arr[index2][areaID];
				}
				return areaName;
			}
		</script>

		<style type="text/css">
			
			
			.businessman_main_innerR06 {
				width: 806px;
				/*height: 892px;*/
				float: left;
				margin-left: 10px;
				border: 1px solid #CCCCCC;
				overflow: hidden;
				margin-top: 10px;
				margin-bottom: 50px;
			}
			
			.businessman_main_innerR06 p {
				margin-right: 8px;
				display: inline-block;
			}
			
			.businessman06_1 {
				margin: 10px 0 0 10px;
			}
			
			.businessman06_2 {
				margin: 10px 0 10px 16px;
				font-weight: bold;
				border-bottom: 1px solid #CCCCCC;
				line-height: 40px;
			}
			
			.businessman06_3,
			.businessman06_4 {
				font-weight: bold;
				height: 18px;
				margin: 39px 0px 29px 370px;
			}
			
			textarea {
				margin: 14px 0 21px 248px;
				width: 254px;
				height: 81px;
			}
			/*.businessman_main_innerR06 input{width: 341px; height: 35px;}*/
			
			div {
				margin-bottom: 21px;
			}
			
			.businessman06_7 {
				margin-left: 187px;
			}
			
			.p04_44 div {
				margin-top: 17px;
				margin-bottom: 20px;
			}
			
			.p04_442 {
				margin: 56px 0 27px 170px;
			}
			
			.p04_443 {
				margin-left: 200px;
			}
			
			.p04_443 input {
				width: 18px;
				height: 18px;
			}
			
			.p04_444 {
				margin-left: 150px;
			}
			
			.p04_445 {
				margin-left: 182px;
			}
			
			.p04_445 input {
				width: 18px;
				height: 18px;
			}
			
			.p04_446 {
				margin-left: 200px;
			}
			
			.p04_447 {
				margin-left: 108px;
			}
			
			.p04_447 select {
				width: 120px;
				height: 35px;
			}
			
			.p04_44_x {
				width: 338px;
				height: 46px;
				/*margin-bottom: 20px;*/
				background: #b20007;
				margin-left: 118px;
				color: #FFFFFF;
				font-size: 22px;
			}
			/*上传身份证*/
			
			.inputFile {
				width: 102px;
				height: 32px;
				opacity: 0;
				overflow: hidden;
				position: absolute;
				z-index: 29;
				left: 45px;
				top: 135px;
			}
			
			#preview2 {
				width: 123px;
				height: 80px;
			}
			/*上传身份证按钮*/
			
			.add_ha {
				margin-left: 46px;
				/*margin-bottom: 50px;*/
				margin-top: 10px;
				width: 102px;
				height: 32px;
				background: #B20007;
				text-align: center;
				line-height: 28px;
				color: #FFFFFF;
				font-size: 14px;
				border-radius: 5px;
			}
			
			select {
				width: 120px;
				height: 35px;
			}
			
			.businessman06_14 {
				margin-bottom: 116px;
			}
			
			.businessman06_14 a {
				width: 148px;
				height: 43px;
				border: 1px solid #CCCCCC;
				text-align: center;
				line-height: 39px;
				display: inline-block;
				font-size: 22px;
				margin-left: 10px;
			}
			
			.p06_4_x {
				width: 182px;
				height: 43px;
				background: #b20007;
				margin-left: 210px;
				color: #FFFFFF;
				font-size: 22px;
				font-weight: bold;
			}
		</style>

		<!--加载头部模板-->
		<script>
			$(function() {
				$('#header01').load('admin-header-footer.html  #header_wrap');
				$('#footer01').load('admin-header-footer.html  #footer_wrap');

			})
		</script>
	</head>

	<body>

		<!--加载头部模板-->
		<div id="header01"></div>

		<div class="inner_admin">
			<div class="aa">
				<div id="leftmenu0">
				<li style="margin-top: 15px;"><img src="img/admin-01.png"/></li>
				<li ><a href="adminManagemant.html">会员管理</a></li>
				<li  style="border-bottom: 1px solid #CCCCCC;"><a href="adminBussinessManage.html">商家管理</a></li>
				<li style="margin-top: 15px;"><img src="img/admin-02.png"/></li>
				<li ><a href="adminCardmanage.html">卡片管理</a></li>
				<li  style="border-bottom: 1px solid #CCCCCC;"><a href="adminCardmanageCashnote.html">现金充值</a></li>
				<li style="margin-top: 15px;"><img src="img/admin-03.png"/></li>
				<li ><a href="adminDetailmanageNoterecord.html">会员交易</a></li>
				<li   style="border-bottom: 1px solid #CCCCCC;"><a href="adminDetailmanageBusdealrecord.html">商家交易</a></li>
				<li style="margin-top: 15px;"><img src="img/admin-04.png"/></li>
				<li ><a href="adminNewsactivy.html">新闻活动</a></li>
				<li  style="border-bottom: 1px solid #CCCCCC;"><a href="serviceReminder.html">账户设置</a></li>

				</div>

				<ul class="li_02">
					<li>常见问题？</li>
					<li>如何入驻聪付？</li>
					<li>忘记支付密码？</li>
					<li>什么是实名认证？</li>
					<li>收不到邮件激活？</li>
					<li>手机充值未到账？</li>
					<li>如何设置安全问题？</li>
				</ul>

			</div>

			<div id="mcont0" class="bb">

				<!--会员管理 - 会员检索 - 信息修改-->
				<div class="businessman_main_innerR06">
					<form action="#">
						<div class="businessman06_1"><img src="img/admin-05.png" /></div>
						<div class="businessman06_2">
							<p>会员信息修改</p>
						</div>

						<div class="p04_442">真实姓名：<input type="text" placeholder="赵云鹤" style="width: 341px; height: 35px;" /> </div>
						<div class="p04_443">性别：
							<input id="man" type="radio" checked="checked" name="1" />男&nbsp;&nbsp;&nbsp;<input id="woman" type="radio" name="1" />女</div>
						<div class="p04_444"> 身份证号码：<input type="text" placeholder="34082319930458258" style="width: 341px; height: 35px;" /></div>
						<div class="p04_445"> 手机号：<input type="text" placeholder="18895731936" style="width: 341px; height: 35px;" /> </div>

						<div class="ai-item upload-id-img" style="margin-left:268px; position: relative; margin-bottom: 44px;">

							<div class="opposite-img" style="margin-left: 40px;">
								<input type="file" id="img2" name="fm" class="inputFile">
								<label for="img2">
                            
                            	<img src="img/p_smrzs.png" id="preview2">
                        </label>
							</div>
							<p style="display: block;  margin-left: 35px;">重新上传身份证照</p>
							
							<p class="add_ha">重新上传</p>

						</div>

						<div class="p04_446"> 职业：<input type="text" placeholder="UI" style="width: 182px; height: 35px;" /> </div>

						<!--下拉列表三级联动区-->
						<p style="margin-left: 172px;">常用地址:</p>
						<select id="seachprov" name="seachprov" onChange="changeComplexProvince(this.value, sub_array, 'seachcity', 'seachdistrict');"></select>&nbsp;&nbsp;
						<select id="seachcity" name="homecity" onChange="changeCity(this.value,'seachdistrict','seachdistrict');"></select>&nbsp;&nbsp;
						<span id="seachdistrict_div"><select id="seachdistrict" name="seachdistrict"></select></span>
						<!--<input hidden="true" id="areahidden"/>-->
						<!--<input type="button" value="获取地区" onClick="showAreaID()" />-->
						<input type="hidden" id="input1" name="input1" />

						<div><textarea></textarea></div>
						
						<div class="businessman06_14">
							<input type="submit" value="完成" class="p06_4_x" onClick="showAreaID()" id="mm" />
							<a>返回</a>
						</div>

					</form>
				</div>

			</div>
		</div>
		<!--加载尾部的内容-->
		<div id="footer01"></div>

	</body>
<script>
	//编辑页面上传图片
    $('#img1').on('change', function () {
        setImgPreview('img1', 'preview');
    });
    $('#img2').on('change', function () {
        setImgPreview('img2', 'preview2');
    });

//上传图片
function setImgPreview(imgObj, prev) {
    var docObj = $("#" + imgObj);
    var imgObjPreview = $("#" + prev);
    //异步上传图片
    uploadImage(docObj, imgObjPreview)
}


function uploadImage(docObj, imgObjPreview) {
    //判断是否有选择上传文件
    var imgPath = docObj.val();
    if (imgPath == "") {
        //alert("请选择上传图片！");
        hDialog.show({ type: 'toast', toastText: '请选择上传图片！', toastTime: 3000, hasMask: false });
        return;
    }
    //判断上传文件的后缀名
    var strExtension = imgPath.substr(imgPath.lastIndexOf('.') + 1).toLowerCase();
    if (strExtension != 'jpg' && strExtension != 'gif'
    && strExtension != 'png' && strExtension != 'bmp') {
        //alert("请选择图片文件！");
        hDialog.show({ type: 'toast', toastText: '请选择图片文件！', toastTime: 3000, hasMask: false });
        return;
    }

    var ImgObj = new Image();      //建立一个图像对象 
    var AllowImgFileSize = 2100000;    //上传图片最大值(单位字节)（ 2 M = 2097152 B ）
    ImgObj.src = docObj[0].value;
    //checkSizeofImg();
    //function checkSizeofImg() {
    //    if (ImgObj.readyState != "complete") { //如果图像是未加载完成进行循环检测         
    //        setTimeout("checkSizeofImg()", 500);
    //        //return false;
    //    }
    //}

    //ImgObj.onload = function () {
    //    ImgFileSize = Math.round(ImgObj.fileSize / 1024 * 100) / 100;//取得图片文件的大小 
    //    if (AllowImgFileSize != 0 && AllowImgFileSize < ImgFileSize) {
    //        hDialog.show({ type: 'toast', toastText: '上传失败，请上传不大于2M的图片！', toastTime: 3000, hasMask: false });
    //        return;
    //    }
    //}

    //var file = $("#" + imgObj).files[0];
    var reader = new FileReader();
    var file = docObj[0].files[0];
    var imgUrlBase64;
    if (file) {
        //将文件以Data URL形式读入页面  
        imgUrlBase64 = reader.readAsDataURL(file);
        reader.onload = function (e) {
            //var result = document.getElementById("result");
            var ImgFileSize = reader.result.substring(reader.result.indexOf(",") + 1).length;
            if (AllowImgFileSize != 0 && AllowImgFileSize < ImgFileSize) {
                hDialog.show({ type: 'toast', toastText: '上传失败，请上传不大于2M的图片！', toastTime: 3000, hasMask: false });
                return;
            }

            //显示文件  
            imgObjPreview.attr("src", reader.result);

            //字符串形式上传  //data:image/png;base64,
            var imgDataBase64 = imgObjPreview.attr("src").substring(imgObjPreview.attr("src").indexOf(",") + 1);
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: { "_Image": imgDataBase64, "_format": "." + strExtension },
                url: ajaxUrl + 'UploadIDCartImageBase64',
                success: function (data) {
                    if (data) {
                        imgObjPreview.attr("src", data);
                        $("." + docObj.attr("name")).val(data);
                        docObj.parent().find('.logo-img2').remove();
                    }
                },
                //此接口返回的图片路径是error的响应文本
                error: function (xhr) {
                    imgObjPreview.attr("src", xhr.responseText);
                    $("." + docObj.attr("name")).val(xhr.responseText);
                    docObj.parent().find('.logo-img2').remove();
                },
                beforeSend: function () {

                    var logoImg = '<img src="../images/loanding.gif" class="logo-img2" style="position: absolute;left: 50%;top: 50%;width: 20px; height: 20px; -webkit-transform: translate(-50%,-50%);">';
                    docObj.parent().append(logoImg);
                }
            });
        }
        reader.onerror = function () {
            alert("error");
        }
    }


}
</script>
</html>